import { BinaryDecision } from "framework/FSM/DecisionTree/Decision";
 
/**
 * 判断PC是否挂了
*/
export class DecisionIsPowerWorkable <T extends IStateArg<PowerCreep>> extends BinaryDecision<T>
{

    public testValue(arg:T): boolean
    {
        if(arg.entity && arg.entity .ticksToLive&& arg.entity.ticksToLive>100)
        {
            const mountroom = arg.entity.ownerRoom();
            if(mountroom.controller?.isPowerEnabled)
            {
                return true;
            }
        }
        return false;
    }

    value: any;


    public setValue(val: any)
    {
        this.value = val;
    }
}

